{include file="header"}
<div class="x-body">
	<xblock>
		<a href="javascript:location.reload();" class="layui-btn layui-btn-warm">
			<i class="icon iconfont"></i> 插件管理
		</a>
		<a class="layui-btn" href="http://www.115cms.com/addons.html" target="_blank"><i class="layui-icon"></i>在线插件</a>
		{:hook('admincomaddons')}
	</xblock>
	<div  style="overflow: auto;">
        <table class="layui-table" style="min-width: 1000px;">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
		<thead>
			<tr>
				<th>图标</th>
				<th>插件名</th>
				<th>插件描述</th>
				<th>版本</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		    <?php foreach (getDir('app/',1) as $v=>$m){?>
			 {if file_exists('app/'.$m.'/'.$m.'.php')}
			<tr>
				<td><div align="center"><a href="http://www.115cms.com/a_html/{:h_config($m,'name')}.html" target="_blank"><img style="border-radius: 10px;height: 80px;width: 80px;" src="{:h_config($m,'pic')}"></a></div></td>
				<td>{:h_config($m,'title')}</td>
				<td>{:h_config($m,'description')}</td>
				<td>V{:h_config($m,'banben')}</td>
				<td id="admin_set">
					{if fun_st('addons', array('name'=>h_config($m,'name')))==0}
					<button type="button" class="layui-btn layui-btn-sm del_t" url="{:url('admin/api/install')}?id={:h_config($m,'name')}" name="确定要这个插件吗?">安装</button>
					<button type="button" class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/unaddons')}?id={:h_config($m,'name')}" name="确定要删除这个模板吗？<br>删除后不可恢复请做好备份">删除</button>
					{else/}
					{if h_config($m,"set")}
					<button type="button" onclick="x_admin_show('{:h_config($m,"title")}管理','{:h_config($m,"set")}')" class="layui-btn layui-btn-warm layui-btn-sm">管理</button>
					{/if}
					{if h_config($m,"admin")==1}
					<button type="button" onclick="x_admin_show('{:h_config($m,"title")}设置','{:url('admin/com/addons_config',array('id'=>h_config($m,'name')))}')" class="layui-btn layui-btn-sm">设置</button>
					{/if}
					<button type="button" class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/uninstall')}?id={:h_config($m,'name')}" name="确定要这个插件吗?">卸载</button>
	    				{/if}
					{:hook('admincomaddonss',array('id'=>h_config($m,"name")))}
				</td>
			</tr>
			{/if}
			<?php } ?>
		</tbody>
	</table>
	</div>
</div>
{include file="footer"}